package com.website.custom.service.impl;

import com.website.common.core.text.Convert;
import com.website.common.utils.DateUtils;
import com.website.custom.domain.WHonorCharm;
import com.website.custom.mapper.WHonorCharmMapper;
import com.website.custom.service.IWHonorCharmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 荣誉与风采Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-03
 */
@Service
public class WHonorCharmServiceImpl implements IWHonorCharmService 
{
    @Autowired
    private WHonorCharmMapper wHonorCharmMapper;

    /**
     * 查询荣誉与风采
     * 
     * @param id 荣誉与风采主键
     * @return 荣誉与风采
     */
    @Override
    public WHonorCharm selectWHonorCharmById(Long id)
    {
        return wHonorCharmMapper.selectWHonorCharmById(id);
    }

    /**
     * 查询荣誉与风采列表
     * 
     * @param wHonorCharm 荣誉与风采
     * @return 荣誉与风采
     */
    @Override
    public List<WHonorCharm> selectWHonorCharmList(WHonorCharm wHonorCharm)
    {
        return wHonorCharmMapper.selectWHonorCharmList(wHonorCharm);
    }

    /**
     * 新增荣誉与风采
     * 
     * @param wHonorCharm 荣誉与风采
     * @return 结果
     */
    @Override
    public int insertWHonorCharm(WHonorCharm wHonorCharm)
    {
        wHonorCharm.setCreateTime(DateUtils.getNowDate());
        return wHonorCharmMapper.insertWHonorCharm(wHonorCharm);
    }

    /**
     * 修改荣誉与风采
     * 
     * @param wHonorCharm 荣誉与风采
     * @return 结果
     */
    @Override
    public int updateWHonorCharm(WHonorCharm wHonorCharm)
    {
        wHonorCharm.setUpdateTime(DateUtils.getNowDate());
        return wHonorCharmMapper.updateWHonorCharm(wHonorCharm);
    }

    /**
     * 批量删除荣誉与风采
     * 
     * @param ids 需要删除的荣誉与风采主键
     * @return 结果
     */
    @Override
    public int deleteWHonorCharmByIds(String ids)
    {
        return wHonorCharmMapper.deleteWHonorCharmByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除荣誉与风采信息
     * 
     * @param id 荣誉与风采主键
     * @return 结果
     */
    @Override
    public int deleteWHonorCharmById(Long id)
    {
        return wHonorCharmMapper.deleteWHonorCharmById(id);
    }

    @Override
    public WHonorCharm getById(Long hcId) {
        return wHonorCharmMapper.getById(hcId);
    }

    @Override
    public Long getMaxId(int type) {
        return wHonorCharmMapper.getMaxId(type);
    }
}
